package com.jsp.servlet; /**
 * @author wzm
 * @create 2023-06-27 9:31
 */

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/write")
public class WriteServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //给浏览器响应html数据
//        PrintWriter writer = response.getWriter();
//        writer.write("<html>");
//        writer.write("<body>");
//        writer.write("<h2>Hello World!</h2>");
//        writer.write("</body>");
//        writer.write("</html>");

        //10000

        //将html内容写到jsp  跳转到jsp就可以了
        response.sendRedirect(request.getContextPath()+"/hello.jsp");



    }
}
